<h5>Search Box</h5>
<div id="search-panel">

<%= form_tag({:action => 'index'}, :method => 'GET') do %>
Text: <input type="text" name="filter[text]" id="filter_text" value="<%= @filter[:text] if !@filter.nil? %>">


Event:
<select name="filter[event_id]" id="filter_event_id">
	<option value="">- All Events -</option>
	<% @events.each do |event|
		@selected = ''
		if !@filter.nil?
			@selected = event.id.to_s == @filter[:event_id] ? 'selected=selected' : ''
		end
	%>
		<option value="<%= event.id.to_s %>" <%= @selected %> ><%= event.title %></option>
	<% end %>
</select>


Status:
<select name="filter[article_status_id]" id="filter_article_status_id">
	<option value="">- All statuses -</option>
	<% @event_statuses.each do |event_status|
		@selected = ''
		if !@filter.nil?
			@selected = event_status.id.to_s == @filter[:event_status_id] ? 'selected=selected' : ''
		end
	%>
		<option value="<%= event_status.id.to_s %>" <%= @selected %> ><%= event_status.title %></option>
	<% end %>
</select>
<input type="submit" title="Search" value="Search" class="button grey" style="height:auto" />

<% end %>

</div>